﻿@{
    ViewData["Title"] = "Home Page";
}
@using MvcSoftDemo.Models;
@model IEnumerable<Product>;

<head>
    <link rel="stylesheet" href="~/css/Base.css">
</head>

<div id="Base">
    <div id="top">
        <div id="Query"><input type="text" name="keyword" placeholder="请输入商品名称的关键字"><input type="button" id="btnQuery" value="查询"></div>
        <div id="Add"><input type="button" id="btnAdd" value="添加"></div>
    </div>
    <div>
        <table id="tb">
            <tr>
                <th>Id</th>
                <th>商品名称</th>
                <th>供应商名称</th>
                <th>价格</th>
                <th>库存数量</th>
                <th>备注</th>
                <th>操作</th>
            </tr>
            @foreach (var item in Model)
            {
                <tr class="tbtr">
                    <td>@item.Id</td>
                    <td>@item.ProductName</td>
                    <td>@item.Supplier</td>
                    <td>@item.Price</td>
                    <td>@item.Stock</td>
                    <td>@item.Remarks</td>
                    <td>
                        <input type="button" onclick="btnEdit(@item.Id)" value="编辑">
                        <input type="button" onclick="btnDel(@item.Id)" value="删除">
                    </td>
                </tr>
            }
        </table>
    </div>
</div>

<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/js/Base.js"></script>